home *** CD-ROM | disk | FTP | other *** search
/ Comix Games / Comix Games.iso / jetsons / jetsons.exe / jetsons.dxr / 00009.ls < prev    next >
Encoding:
Text File  |  1996-11-19  |  4.5 KB  |  99 lines

  1. on MoveBuildings
  2.   global theFirstBuildingChannel, theLastBuildingChannel, theBackgroundVelocity, theBuildingCount, theMaxNumBuildings, theFirstDropOffBuilding, theSecondDropOffBuilding, theThirdDropOffBuilding, theFourthDropOffBuilding, theLastDropOffBuilding
  3.   if theBackgroundVelocity < 0 then
  4.     repeat with h = theFirstBuildingChannel to theLastBuildingChannel
  5.       if the right of sprite h < 0 then
  6.         set x1 to the stageRight - the stageLeft
  7.         set x2 to x1 + the width of sprite h
  8.         set y1 to the top of sprite h
  9.         set y2 to the bottom of sprite h
  10.         spriteBox(h, x1, y1, x2, y2)
  11.         set theBuildingCount to 1 + theBuildingCount
  12.         if theBuildingCount > theMaxNumBuildings then
  13.           set theBuildingCount to 1
  14.         end if
  15.         if theBuildingCount = theFirstDropOffBuilding then
  16.           set the memberNum of sprite h to the number of member "Drop Off 1"
  17.         else
  18.           if theBuildingCount = theSecondDropOffBuilding then
  19.             set the memberNum of sprite h to the number of member "Drop Off 2"
  20.           else
  21.             if theBuildingCount = theThirdDropOffBuilding then
  22.               set the memberNum of sprite h to the number of member "Drop Off 3"
  23.             else
  24.               if theBuildingCount = theFourthDropOffBuilding then
  25.                 set the memberNum of sprite h to the number of member "Drop Off 4"
  26.               else
  27.                 if theBuildingCount = theLastDropOffBuilding then
  28.                   set the memberNum of sprite h to the number of member "Drop Off 5"
  29.                 else
  30.                   set the memberNum of sprite h to getRandomHouse()
  31.                 end if
  32.               end if
  33.             end if
  34.           end if
  35.         end if
  36.       else
  37.         set the locH of sprite h to the locH of sprite h + (theBackgroundVelocity / 2)
  38.       end if
  39.       set the stretch of sprite h to 0
  40.     end repeat
  41.   else
  42.     repeat with h = theFirstBuildingChannel to theLastBuildingChannel
  43.       if the left of sprite h > (the stageRight - the stageLeft) then
  44.         set x1 to 0 - the width of sprite h
  45.         set x2 to x1 + the width of sprite h
  46.         set y1 to the top of sprite h
  47.         set y2 to the bottom of sprite h
  48.         spriteBox(h, x1, y1, x2, y2)
  49.         set theBuildingCount to theBuildingCount - 1
  50.         if theBuildingCount < 1 then
  51.           set theBuildingCount to theMaxNumBuildings
  52.         end if
  53.         set temp to theBuildingCount - GetNumScreenBuildings() + 1
  54.         if temp = theFirstDropOffBuilding then
  55.           set the memberNum of sprite h to the number of member "Drop Off 1"
  56.         else
  57.           if temp = theSecondDropOffBuilding then
  58.             set the memberNum of sprite h to the number of member "Drop Off 2"
  59.           else
  60.             if temp = theThirdDropOffBuilding then
  61.               set the memberNum of sprite h to the number of member "Drop Off 3"
  62.             else
  63.               if temp = theFourthDropOffBuilding then
  64.                 set the memberNum of sprite h to the number of member "Drop Off 4"
  65.               else
  66.                 if temp = theLastDropOffBuilding then
  67.                   set the memberNum of sprite h to the number of member "Drop Off 5"
  68.                 else
  69.                   set the memberNum of sprite h to getRandomHouse()
  70.                 end if
  71.               end if
  72.             end if
  73.           end if
  74.         end if
  75.       else
  76.         set the locH of sprite h to the locH of sprite h + (theBackgroundVelocity / 2)
  77.       end if
  78.       set the stretch of sprite h to 0
  79.     end repeat
  80.   end if
  81.   if theBackgroundVelocity < 0 then
  82.     if sprite theFirstBuildingChannel intersects theLastBuildingChannel then
  83.       if the locH of sprite theFirstBuildingChannel < the locH of sprite theLastBuildingChannel then
  84.         set the locH of sprite theLastBuildingChannel to the locH of sprite theLastBuildingChannel + the width of sprite theFirstBuildingChannel
  85.       else
  86.         set the locH of sprite theFirstBuildingChannel to the locH of sprite theFirstBuildingChannel + the width of sprite theLastBuildingChannel
  87.       end if
  88.     end if
  89.   else
  90.     if sprite theFirstBuildingChannel intersects theLastBuildingChannel then
  91.       if the locH of sprite theFirstBuildingChannel > the locH of sprite theLastBuildingChannel then
  92.         set the locH of sprite theFirstBuildingChannel to the locH of sprite theFirstBuildingChannel + the width of sprite theLastBuildingChannel
  93.       else
  94.         set the locH of sprite theLastBuildingChannel to the locH of sprite theLastBuildingChannel + the width of sprite theFirstBuildingChannel
  95.       end if
  96.     end if
  97.   end if
  98. end
  99.